<style>
.mga_er{ color:#F90;}
</style>
<script src="//code.jquery.com/jquery-1.11.0.min.js"></script>
<script>
	$(document).ready(function(e) {		
		$('#mga_ct_seach_lo').ready(function(e) {
			var name=$('#mga_input_set_ck_sch').val();		
			if(name!="")
			{
					var rq=$.ajax({
					type: "POST",
					url: "../public/js/ajax/search/search.php",
					data:{j_name:name},					
						});
		//callback			
				rq.done(function (msg){						
						$('#mga_ct_seach_lo').html(msg);
				//window.location.reload();
				 });				
			}
			else
			{
				$('#mga_ct_seach_lo').html('<span class="mga_er">Chưa nhập tên sản phẩm, xin vui lòng nhậm tên sản phẩm</span>');
			}
        });
       
    });
</script>

 <nav class="mnu-top navbar navbar-inverse " role="navigation">
        <div class="container">
            <a class="brand-decorvn navbar-brand " href="#"><img src="<?php echo site_url("public") ?>/images/logo.png" alt="Decorvn.com"/></a>
             <ul class="nav navbar-nav algin" id="mga_menu_top">
                <li class="active"><a href="<?php echo site_url("home") ?>">Trang chủ</a></li>
                <?php 
				foreach($menutop as $rows)
					{
						$id=$rows['id'];
						$name=$rows['name'];	
						$parent=$rows['parent'];
						if($parent==0)
									echo'
									<li><a href="http://localhost/decorvn/home/sanpham/'.$id.'/0">'.$name.'</a></li>                					
									';			
					}
				?>
                
                <li><a href="<?php echo site_url("home/lienhe") ?>">Liên Hệ</a></li>
        <form class="navbar-form navbar-left frm-search" role="search" method="get" action="http://localhost/decorvn/home/search">
        <div class="form-group">
        	<?php
				$txt_sch="";
				if( isset($_GET['search'])!=""||isset($_GET['search'])!=NULL)
				{
					$txt_sch=$_GET['search'];					
				}
			 ?>
          <input id="mga_input_set_ck_sch" type="search" name="search" value="<?php echo $txt_sch;?>" class="form-control input-sm" placeholder="Tên sản phẩm ..."/>
          <button type="submit" style="height:29px; margin-left:-4px;" id="mga_btn_set_ck_sch">
          	<img src="../public/images/admin/search.png" width="20" height="20" title="Tìm kiếm sản phẩm"/>
          </button>
        </div>
      </form>
             </ul>
        </div> 
  </nav>
    
 
    <!--end container-->
  